package me.firstapp.service.bbs;

import java.util.List;
import java.util.Map;

import me.firstapp.common.utils.Page;
import me.firstapp.module.bbs.Advertisement;

public interface AdvertisementService {

	/**
	 * 通过id查询广告
	 * 
	 * @param id
	 * @param apiClientId
	 * @return
	 */
	Advertisement findAdvertisementById(Long id, Long apiClientId);

	/**
	 * 广告新增
	 * 
	 * @param title
	 * @param description
	 * @param image
	 * @param url
	 * @param startDate
	 * @param endDate
	 * @param sort
	 * @param apiClientId
	 * @return
	 */
	Advertisement addAdvertisement(String title, String description, String image, String url, Long startDate,
			Long endDate, Integer sort, Long apiClientId);

	/**
	 * 更新广告
	 * 
	 * @param id
	 * @param title
	 * @param description
	 * @param image
	 * @param url
	 * @param startDate
	 * @param endDate
	 * @param status
	 * @param sort
	 * @param apiClientId
	 * @return
	 */
	Advertisement updateAdvertisement(Long id, String title, String description, String image, String url,
			Long startDate, Long endDate, Integer status, Integer sort, Long apiClientId);

	/**
	 * 删除广告
	 * 
	 * @param ids
	 * @param apiClientId
	 */
	void deleteAdvertisements(String ids, Long apiClientId);

	/**
	 * 查询广告列表
	 * 
	 * @param apiClientId
	 * @return
	 */
	List<Advertisement> findAvailableAds(Long apiClientId);

	/**
	 * 分页查询广告
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param searchParams
	 * @param sortParam
	 * @param sortType
	 * @param apiClientId
	 * @return
	 */
	Page<Advertisement> findAdvertisementPage(Integer pageNo, Integer pageSize, Map<String, Object> searchParams,
			String sortParam, String sortType, Long apiClientId);
}
